Skip to content

feat: add Linux desktop launcher for dev builds#5076

Open
hobson wants to merge 1 commit into
ankitects:mainfrom
totalgood:master
Open

feat: add Linux desktop launcher for dev builds#5076
hobson wants to merge 1 commit into
ankitects:mainfrom
totalgood:master

Conversation

@hobson

@hobson hobson commented Jun 29, 2026

Copy link
Copy Markdown

Adds tools/anki-dev.desktop with an ANKI_SRC placeholder and install instructions in README.md for XDG-compatible desktops (GNOME, KDE, etc.).

Linked issue (required)

Fixes #5075

Summary / motivation (required)

Adds tools/anki-dev.desktop with paramaterized ANKI_SRC path for configuration by developer/tester wishing to integrate a pre-release dev version of the Anki app with their Desktop for testing or daily use.

Steps to reproduce (required, use N/A if not applicable)

N/A

How to test (required)

Compile with just run and then follow the newly added instructions in updated README.md section ### Linux Desktop Integration:

# From the repo root
sed "s|ANKI_SRC|$(pwd)|g" tools/anki-dev.desktop \
    > ~/.local/share/applications/anki-dev.desktop
update-desktop-database ~/.local/share/applications/

Open your app grid, find Anki (dev), and launch, pinning it to your toolbar or right click and "Add to Favorites" to verify it launches correctly and is integrated with your particular XDG-compatible Linux Desktop. To verify live (--editable) install, add a new feature and recompile before launching and testing the "Anki (dev)" desktop app.

Checklist (minimum)

  • I ran just check
  • Could not identify a new test.

Details

Works as expected on Ubuntu 26.04:

  • Launches from the ⊞ or "app grid" keyboard key then "Anki"
  • Pinnable icon is shown in the Taskbar/Toolbar after launch

After installing Anki (dev) with this Desktop file, and updating the Software Registry in Ubuntu 26.04 (see new README.md section), the Software Manager (gnome-software) does not list Anki (dev) under the "Installed" tab, but rather the released "Anki" app which has not been installed. Clicking on that app redirects to the Install link for the Flatpack/release version.

Before / after behavior (optional)

N/A

Risk / compatibility / migration (optional)

N/A (developer-only feature)

UI evidence (required for visual changes; otherwise N/A)

image image

Scope

  • This PR is focused on one change (no unrelated edits).

Adds tools/anki-dev.desktop with an ANKI_SRC placeholder and install
instructions in README.md for XDG-compatible desktops (GNOME, KDE, etc.).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 Anki | 🛠️ Build #33362238 | 📁 Comparing d007fdd against latest (b00308e)

  🔍 Preview build  

1 file changed
± index.html

@GithubAnon0000 GithubAnon0000 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You wrote you

would like to be able to run and test the Anki frontend and backend as it would appear to a user when user installs the latest release

Why is an additional .desktop file needed? Anki already ships a .desktop file.


And for every place where you use ANKI_SRC, I know you said this:

ANKI_SRC placeholder

But what's the point if the placeholder needs to be manually edited in order to work?

Comment thread tools/anki-dev.desktop
Comment on lines +1 to +9
[Desktop Entry]
Name=Anki (dev)
Comment=Spaced repetition flashcard program
Exec=bash -c 'cd ANKI_SRC && just run'
Icon=ANKI_SRC/qt/aqt/data/qt/icons/anki.png
Terminal=false
Type=Application
Categories=Education;
StartupWMClass=anki

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if an additional .desktop file would make sense (I don't see how), generating one with claude isn't advised. Just make a copy of the already existing file and update accordingly. Your version just causes inconcistencies.

https://github.com/ankitects/anki/blob/35de142312afedf023ebbbe24599afa1e44f300e/qt/installer/linux-template/%7B%7B%20cookiecutter.format%20%7D%7D/%7B%7B%20cookiecutter.app_name%20%7D%7D/anki.desktop

Comment thread README.md
Comment on lines +30 to +42
## Linux Desktop Integration

On any Linux desktop that follows the [XDG spec](https://specifications.freedesktop.org/desktop-entry-spec/latest/) (GNOME, KDE, XFCE, Cinnamon, MATE, and others), you can install a launcher entry for the development build so it appears in your app grid and can be pinned to the dock.

```bash
# From the repo root
sed "s|ANKI_SRC|$(pwd)|g" tools/anki-dev.desktop \
> ~/.local/share/applications/anki-dev.desktop
update-desktop-database ~/.local/share/applications/
```

Then open your app grid, search for **Anki (dev)**, right-click, and choose **Add to Favourites** (GNOME) or the equivalent for your desktop.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current way anki is doing this is already integrated into the desktop.

Aside from that, I don't think we should be teaching people how to pin an icon. That differs for every OS and WM and could change with major versions of OSs or WMs.

Comment thread tools/anki-dev.desktop
Name=Anki (dev)
Comment=Spaced repetition flashcard program
Exec=bash -c 'cd ANKI_SRC && just run'
Icon=ANKI_SRC/qt/aqt/data/qt/icons/anki.png

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The icon at qt/aqt/data/qt/icons/anki.png isn't the desktop icon. And your image shows that your PR creates an inconsistency, because anki now has a settings icon in the app overview.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat (dev tooling): Add an "Anki (dev)" .desktop file to complete dev app install on Ubuntu, Mint, etc.

2 participants